<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>管理后台</title>
    {% load staticfiles %}
    <link href="{% static "css/bootstrap.min.css" %}" rel="stylesheet">
    <style>
        .message{
            display: inline-block;
            margin: 0 0 20px;
            background:rgb(253, 253, 177);
            padding: 5px 10px;
            border-radius: 4px;
            color:green;
        }
        .header{
            padding: 30px 0;
        }
        .logout{margin-top:25px;}
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="logout pull-right">
            <a href="/dashboard/users/" class="btn btn-default">所有用户</a>
            <a href="/dashboard/logout/" class="btn btn-info">退出</a>
            </div>
            <h1>管理后台</h1>
        </div>
        {% if messages %}
            {% for message in messages %}
                <div class="alert alert-warning" role="alert">{{message}}</div>
            {% endfor %}
        {% endif %}
        {% if message %}<div class="alert alert-success" role="alert">{{message}}</div>{% endif %}
        <!-- <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">上传明星照片</h3>
            </div>
            <div class="panel-body">
                <form class="login-form" enctype="multipart/form-data" id="loginForm" action="/dashboard/star/" method="post">
                    <div class="form-group">
                        <label for="nameInput">明星名字</label>
                        <input type="text" required name="name" id="nameInput" class="form-control" placeholder="明星名字">
                    </div>
                    <div class="form-group">
                        <label for="pictureFile">明星照片</label>
                        <input type="file" required name="picture" id="pictureFile" class="form-control" placeholder="明星照片">
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary">提交</button>
                    </div>
                    {% csrf_token %}
                </form>
            </div>
        </div> -->
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">更改数据</h3>
            </div>
            <div class="panel-body">
                <form class="login-form" id="loginForm" action="/dashboard/money/" method="post">
                    <div class="form-group">
                        <label for="moneyInput">金额</label>
                        <input type="text" required name="money" id="moneyInput" class="form-control" placeholder="填写金额" required value="{{data.money}}">
                    </div>
                    <div class="form-group">
                        <label for="peopleInput">人数</label>
                        <input type="text" required name="people" id="peopleInput" class="form-control" placeholder="填写金额" required value="{{data.people}}">
                    </div>
                    <div class="form-group">
                        <label>日期</label>
                        <div class="form-inline">
                            <div class="form-group">
                                <input type="text" required name="year" class="form-control" placeholder="填写年数" required value="{{data.year}}">
                                <label for="moneyInput">年</label>
                            </div>
                            <div class="form-group">
                                <input type="text" required name="month" class="form-control" placeholder="填写月数" required value="{{data.month}}">
                                <label for="moneyInput">月</label>
                            </div>
                            <div class="form-group">
                                <input type="text" required name="day" class="form-control" placeholder="填写日期" required value="{{data.day}}">
                                <label for="moneyInput">日</label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary">提交</button>
                    </div>
                    {% csrf_token %}
                </form>
            </div>
        </div>
    </div>
    <script>
        setTimeout(function(){
            var alertEl = document.getElementsByClassName('alert');
            if(!alertEl) return;
            for(var i=0,l=alertEl.length; i<l; i++){
                alertEl[i].style.display = 'none';
            }
        }, 3000);
    </script>
</body>
</html>